#!/bin/bash

./build.sh
# 启动 代理服务 docker 镜像
export DOCKER_VESSEL="mysql,redis,nexus3,alist,aria2,video,nginx_proxy"
#export DOCKER_VESSEL="nginx_proxy"

# 容器 网络配置
export YML_NETWORKS="service_network"
export YML_SUBNET_IP="192.168.13.0/24"
export DOCKER_ROOT_VOLUME="/mnt/cache/app-date"
# mysql 配置
export DOCKER_VESSEL_MYSQL_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/hq_my_service/services:mysql9.0.1"
export DOCKER_VESSEL_MYSQL_IPV4="240"
export DOCKER_VESSEL_MYSQL_ENVIRONMENT="1813033378"
export DOCKER_VESSEL_MYSQL_PORTS="3306"
export DOCKER_VESSEL_MYSQL_VOLUMES="/mysql"
# redis 配置
export DOCKER_VESSEL_REDIS_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/hq_my_service/services:redis7.4.0"
export DOCKER_VESSEL_REDIS_IPV4="241"
export DOCKER_VESSEL_REDIS_PORTS="6379"
export DOCKER_VESSEL_REDIS_COMMAND="--appendonly yes --requirepass 1813033378"
# nexus3 配置
export DOCKER_VESSEL_NEXUS3_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/hq_my_service/images_back:nexus3-latest"
export DOCKER_VESSEL_NEXUS3_IPV4="242"
export DOCKER_VESSEL_NEXUS3_PORTS="8081"
export DOCKER_VESSEL_NEXUS3_VOLUMES="/nexus3"
# alist 配置
export DOCKER_VESSEL_ALIST_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/hq_my_service/images_back:alist-latest"
export DOCKER_VESSEL_ALIST_IPV4="243"
export DOCKER_VESSEL_ALIST_PORTS="5244"
export DOCKER_VESSEL_ALIST_VOLUMES="/alist"
# aria2 配置
export DOCKER_VESSEL_ARIA2_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/hq_my_service/services:aria2"
export DOCKER_VESSEL_ARIA2_IPV4="244"
export DOCKER_VESSEL_ARIA2_PORTS="6800"
export DOCKER_VESSEL_ARIA2_ENVIRONMENT_RPC_SECRET="1813033378" # rpc服务密钥
export DOCKER_VESSEL_ARIA2_ENVIRONMENT_ARIA2_CONF_DIR="/etc/aria2" # 配置文件目录
export DOCKER_VESSEL_ARIA2_ENVIRONMENT_DOWLOAD_DIR="/downloads" # 下载目录
export DOCKER_VESSEL_ARIA2_VOLUMES_ARIA2="/aria2"
export DOCKER_VESSEL_ARIA2_VOLUMES_DOWNLOADS="/downloads"

# video 视频服务配置
export DOCKER_VESSEL_VIDEO_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/utlis/build:ubuntu-22.04-video_services" # 指定镜像名称和标签
export DOCKER_VESSEL_VIDEO_IPV4="245"
export DOCKER_VESSEL_VIDEO_PORT=82
export DOCKER_VESSEL_VIDEO_ENVIRONMENT_PREFIX="/usr/local"
export DOCKER_VESSEL_VIDEO_APP_PORT=80
export DOCKER_VESSEL_VIDEO_MYSQL_HOST=192.168.10.253
export DOCKER_VESSEL_VIDEO_MYSQL_PORT=3306
export DOCKER_VESSEL_VIDEO_MYSQL_DATABASE="video"
export DOCKER_VESSEL_VIDEO_MYSQL_USER=root
export DOCKER_VESSEL_VIDEO_MYSQL_PASSWORD=1813033378

export DOCKER_VESSEL_VIDEO_REDIS_HOST=192.168.10.253
export DOCKER_VESSEL_VIDEO_REDIS_PORT=6379
export DOCKER_VESSEL_VIDEO_REDIS_DATABASE=0
export DOCKER_VESSEL_VIDEO_REDIS_PASSWORD=1813033378

export DOCKER_VESSEL_VIDEO_VOLUMES="/video-service"

# nginx proxy 配置
export DOCKER_VESSEL_NGINX_PROXY_IMAGE="crpi-vb403qyxdijc0eq9.cn-guangzhou.personal.cr.aliyuncs.com/utlis/build:22_04_nginx_proxy_frpc"
export DOCKER_VESSEL_NGINX_PROXY_IPV4="246"
#export DOCKER_VESSEL_NGINX_PROXY_HTTP_PORT=80
#export DOCKER_VESSEL_NGINX_PROXY_HTTPS_PORT=443
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_DNS_EMAIL="1813033378@qq.com"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_DNS_TOKEN_ID="580573"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_DNS_TOKEN="40cdaa15eb89061889d505bf6a4b9428"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_DNS_DOMAIN="hq1813033378.site"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_DNS_TYPE="A"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_PUBLIC_IP="110.42.45.236"
# frpc 配置
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_FRP_SERVER_PORT=3370
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_FRP_SERVER_METHOD=token
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_FRP_TOKEN=1813033378
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_FRP_DOMAIN="*.hq1813033378.site"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_FRP_LOCAL_IP=192.168.13.246
nas="nas,http://192.168.255.253:80"
pve="pve,https://192.168.255.254:8006"
alist="alist,http://192.168.13.243:5244"
nexus3="nexus3,http://192.168.13.242:8081"
video="video,http://192.168.13.245:80"

#export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_NGINX_HTTPS_PROXY="${nas};${pve};${alist};${nexus3};${video}"
export DOCKER_VESSEL_NGINX_PROXY_ENVIRONMENT_NGINX_LOCAL_RESOURCES="gradle,/gradlebin"
export DOCKER_VESSEL_NGINX_PROXY_VOLUMES_NGINX="/nginx"
export DOCKER_VESSEL_NGINX_PROXY_VOLUMES_CERTBOT="/certbot"
export DOCKER_VESSEL_NGINX_PROXY_VOLUMES_FRPC="/frpc"


util-docker -cmd docker_compose